import os
import shutil

mypath = ".\data\mask"
files = os.listdir(mypath)

count = 10000

#for i in files:
#    nowpath = os.path.join(mypath,i)
#    filename = os.listdir(nowpath)
#
#    for j in filename:
#        src = os.path.join(nowpath,j)
#        newname = str(count)+".jpg"
#        count = count+1
#        dst = os.path.join(nowpath,newname)
#        os.rename(src,dst)


for i in files:
    nowpath = os.path.join(mypath, i)
    print(nowpath)
    filename = os.listdir(nowpath)

    for j in filename:
        src = os.path.join(nowpath, j)
        dst = os.path.join(mypath,j)
        shutil.move(src,dst)


